package homework;

import java.util.Scanner;

public class day04 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        /*System.out.println("请选择业务: 1.查询 2.存款 3.取款 4.退卡");
        int command = scan.nextInt();
        switch (command){
            case 1:
                System.out.println("查询业务");
                break;
            case 2:
                System.out.println("存款业务");
                break;
            case 3:
                System.out.println("取款业务");
                break;
            case 4:
                System.out.println("退卡成功");
                break;
            default:
                System.out.println("输入错误");
        }
        //guessing猜数字之while版
        int num = (int)(Math.random()*1000+1);
        System.out.println(num);*/
        /*System.out.println("猜吧!");
        int guess = scan.nextInt();
        while (guess!=num){
            if (guess>num){
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
            System.out.println("猜吧!");
            guess = scan.nextInt();
        }
        System.out.println("恭喜你猜对了!");*/

        //guessing猜数字之do....while版
       /* int guess;
        do {
            System.out.println("猜吧!");
            guess = scan.nextInt();
           if (guess>num){
               System.out.println("猜大了");
           }else if (guess<num){
               System.out.println("猜小了");
           }else {
               System.out.println("恭喜你猜对了");
           }
        }while(guess!=num);
        */
        //for循环
        //输出5次"行动是成功的阶梯"

        for (int tinmes=0;tinmes<5;tinmes++){
            System.out.println("行动是成功的阶梯");
        }
        System.out.println("继续执行...");

        //输出9的乘法表
        for (int num=1;num<=9;num++){//1到9
            System.out.println(num+"*9="+num*9);
        }
        System.out.println("继续执行...");

        for (int num=1;num<=9;num+=2){//1,3,5,7,9
            System.out.println(num+"*9="+num*9);
        }
        System.out.println("继续执行...");

        for (int num=9;num>=1;num--){//从9到1
            System.out.println(num+"*9="+num*9);
        }
        System.out.println("继续执行...");
        //累加1到100的和
        //sum=1+2+3+4+...+99+100=?
        int sum = 0;
        for (int i=1;i<=100;i++){
            sum = sum+i;
        }
        System.out.println("sum="+sum);

        for (int num=0;num<=9;num++){
            if (num==4){
                break;
            }
            System.out.println(num+"*9="+num*9);
        }
        for (int num=0;num<=9;num++){
            if (num%3==0){
                continue;
            }
            System.out.println(num+"*9="+num*9);
        }







    }

}
